﻿
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>iBOS/e eForum</title>

</head>

<body> 


<!---Get the topic code -- COLLABCODE past as url--->

<cfset thetopiccode = Trim(form.args) />
<cfset beginning    = Val(form.startpoint) />

<CFSET getComments.RecordCount = 0 />

	<!---Do I have the access--->
    <cfquery name="getAcces" datasource="#client.company_dsn#" >
    
        SELECT ISALLOWED
          FROM ECRTCOLLAB
         WHERE COLLABCODE = '#thetopiccode#' AND USERID = '#client.USERID#';   
    
    </cfquery>
    
    <cfset isallowed = 'N' />
    
        <cfif Trim(Ucase(getAcces.ISALLOWED) ) EQ 'Y' >
    
			<cfset isallowed = 'Y' />
            
            <cfquery name="getTopicContent" datasource="#client.company_dsn#" >
    
                SELECT CONTENT, DATECREATED, FOLDERCODE
                  FROM  ECRGCOLLABTHREAD
                 WHERE COLLABCODE = '#thetopiccode#';
            
            </cfquery>
            
            <cfquery name="getUserID" datasource="#client.company_dsn#" >
            
                SELECT USERID
                  FROM ECRGCOLLAB
                 WHERE FOLDERCODE = '#getTopicContent.FOLDERCODE#';
            
            </cfquery>
            
        <cfelse>
         	<cfset isallowed = 'N' />
        </cfif>
        
 <cfoutput>~trimstartshere2~</cfoutput>        
        
        

<cfif isallowed EQ 'Y'>


<!---Get the topic--->
        <cfquery name="getTopic" datasource="#client.company_dsn#" >
        
            SELECT CONTENT, DATECREATED
              FROM ECRGCOLLABTHREAD
             WHERE COLLABCODE = '#thetopiccode#';
        
        </cfquery>
        
        <!---Get the comments to this topic ---> 
        <cfquery name="getComment" datasource="#client.company_dsn#" >
        
            SELECT COMMENTID, COLLABCODE, USERID, MESSAGE, DATECREATED
              FROM ECINCOLLABDISC
             WHERE COLLABCODE = '#thetopiccode#' AND USERID = '#client.USERID#'
             ;
        </cfquery>
        
       
        
<!---convert time to words--->
	<cfset thedate = "#dateformat(getTopicContent.DATECREATED, "YYYY-MM-DD")# #timeformat(getTopicContent.DATECREATED, "HH:MM:SS")#" />
                            
	<cfset ddiff_second = datediff("s", thedate, Now()) />
    <cfset ddiff_minute = datediff("n", thedate, Now()) />
    <cfset ddiff_hour   = datediff("h", thedate, Now()) />
    <cfset ddiff_day    = datediff("d", thedate, Now()) />
    <cfset ddiff_week   = datediff("w", thedate, Now()) />
    <cfset ddiff_month  = datediff("m", thedate, Now()) />
    <cfset ddiff_year   = datediff("yyyy", thedate, Now()) />
                            
<cfif ddiff_second LT 60 AND ddiff_minute LT 1 AND ddiff_hour LT 1 AND ddiff_day LT 1 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
	<cfif ddiff_second EQ 60>
        <cfset aaggoo = 'about a minute ago'> 
    <cfelse>
		<cfset aaggoo = 'a few seconds ago'> 
    </cfif>
    
<cfelseif ddiff_minute LT 60 AND ddiff_hour LT 1 AND ddiff_day LT 1 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
    <cfif ddiff_minute EQ 60>
        <cfset aaggoo = 'about an hour ago'>
    <cfelseif ddiff_minute EQ 1>
        <cfset aaggoo = 'a minute ago'>
    <cfelse>
        <cfset aaggoo = '#ddiff_minute# minutes ago'>
    </cfif>
    
<cfelseif ddiff_hour LT 24 AND ddiff_day LT 1 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
    <cfif ddiff_hour EQ 24>
        <cfset aaggoo = 'about a day ago'>
    <cfelseif ddiff_hour EQ 1>
        <cfset aaggoo = 'about an hour ago'>
    <cfelseif ddiff_hour EQ 0>
        <cfset aaggoo = '#ddiff_minute# minutes ago'>
    <cfelse>
        <cfset aaggoo = '#ddiff_hour# hours ago'>
    </cfif>
    
<cfelseif ddiff_day LT 7 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
    <cfif ddiff_day EQ 7>
        <cfset aaggoo = 'about a week ago'>
    <cfelseif ddiff_day EQ 1>
        <cfset aaggoo = 'about a day ago'>
    <cfelseif ddiff_day EQ 0>
        <cfset aaggoo = '#ddiff_hour# hours ago'>
    <cfelse>
        <cfset aaggoo = '#ddiff_day# days ago'>
    </cfif>
    
<cfelseif ddiff_week LT 4 AND ddiff_month LT 1 AND ddiff_year LT 1>
    <cfif ddiff_week EQ 4>
        <cfset aaggoo = 'about a month ago'>
    <cfelseif ddiff_week EQ 1>
        <cfset aaggoo = 'about a week ago'>
    <cfelseif ddiff_week EQ 0>
        <cfset aaggoo = '#ddiff_day# days ago'>
    <cfelse>
        <cfset aaggoo = '#ddiff_week# weeks ago'>
    </cfif>
    
<cfelseif ddiff_month LT 12 AND ddiff_year LT 1>
    <cfif ddiff_month EQ 12>
        <cfset aaggoo = 'about a year ago'>
    <cfelseif ddiff_month EQ 1>
        <cfset aaggoo = 'about a month ago'>
    <cfelseif ddiff_month EQ 0>
        <cfset aaggoo = '#ddiff_week# weeks ago'>
    <cfelse>
    
        <cfset aaggoo = '#ddiff_month# months ago'>
    </cfif>
    
<cfelse>
    <cfif ddiff_year EQ 1>
        <cfset aaggoo = 'about a year ago'>
    <cfelse>
        <cfset aaggoo = '#ddiff_year# years ago'>
    </cfif>
</cfif>
	
        <!---get profile--->
        <cfquery name="getProfileTopic" datasource="#client.company_dsn#" maxrows="1">
        
        	SELECT USERGRPID_FK, FOLDERCODE
              FROM ECRTCOLLAB
             WHERE USERID = '#getUserID.USERID#' AND ISALLOWED = 'Y'
             <cfif Ucase(client.DBMS) EQ 'MYSQL'>
             LIMIT 1;
			 <cfelseif Ucase(client.DBMS) EQ 'MSSQL'>
			 	; 
			 </cfif>
        
         </cfquery>
         <cfquery name="getProfile" datasource="#client.company_dsn#" maxrows="1">
        
        	SELECT USERGRPID_FK, FOLDERCODE
              FROM ECRTCOLLAB
             WHERE USERID = '#client.USERID#' AND ISALLOWED = 'Y'
             <cfif Ucase(client.DBMS) EQ 'MYSQL'>
             LIMIT 1;
			 <cfelseif Ucase(client.DBMS) EQ 'MSSQL'>
			 	 ;
			 </cfif>
        
         </cfquery>
        <!---end get profile--->
    
        <cfset myfullname   = getProfile.USERGRPID_FK />
        <cfset myavatarreal = getProfile.FOLDERCODE />
        <cfset namefull = getProfile.USERGRPID_FK />

				

			<!---COMMENT BLOCK--->
                    <cfquery name="getComments" datasource="#client.company_dsn#" >
                
                        SELECT COMMENTID, COLLABCODE, USERID, MESSAGE, DATECREATED
                          FROM ECINCOLLABDISC
                         WHERE COLLABCODE = '#thetopiccode#';
                    
                    </cfquery>
            
            <cfif beginning EQ 0 >
                 <!---TOPIC BLOCK--->
                <tr>
                
                    <td  ><div style="background-color: #0FF; width: 60px; height: 60px;"><img src="<cfoutput>#getProfileTopic.FOLDERCODE#</cfoutput>" width="100%" height="100%"/></div></td>
                    <td>
                     <table border="0">
                        <tr><td style="font-size: .9em; font-family: Arial, Helvetica, sans-serif"><cfoutput><strong>#getProfileTopic.USERGRPID_FK#&nbsp;&nbsp;&nbsp;</strong>  <span style="font-size: .8em" title="<cfoutput>#thedate#</cfoutput>">#aaggoo#</span></cfoutput> </td></tr>
                     </table>	
                    </td>
                </tr>
                
               
                <tr >
                    <td border="0" bordercolor="#FFF" style="border-bottom: solid 1px #CCC;">&nbsp;</td>
                    <td>
                     <table border="0" bordercolor="#FFF" >
                        <tr>
                        	<td style="font-family: Arial, Helvetica, sans-serif"><cfoutput>#getTopicContent.CONTENT#</cfoutput>
                            <!---<hr width="430" align="center" noshade="false" size="1">--->
                        </td>
                        </tr>
                     </table>	
                    </td>
                </tr>
               
                <!---END TOPIC BLOCK--->
               
                
                
                
                <tr>
                    
                    <td border="0" bordercolor="#FFF" >&nbsp;</td>
                    
                    
                    
                    <td>
                        <table border="0" bordercolor="#FFF">
                      
                            <!---COMMENT TEXT AREA--->
                            
                            
                            <tr>
                                <td>
                                    <div style="width: 50px; height: 50px;"><img alt="no image" src="<cfoutput>#myavatarreal#</cfoutput>" width="100%" height="100%"/></div>
                                </td>
                                <td>
                                    <table border="0" bordercolor="#FFF" >
                                      <cfset namefull = myfullname />
                                      <tr><td><textarea class="textareac" id="commentment" placeholder="Write a comment..." style="width: 350px;"></textarea>
                                         <li style="list-style: none; height: auto; width: 50px;" onclick="commentclick('thecontainer','commentment', '<cfoutput>#thetopiccode#</cfoutput>', '<cfoutput>#myavatarreal#</cfoutput>', '<cfoutput>#client.USERID#</cfoutput>', '<cfoutput>#namefull#</cfoutput>' )" class="ui-state-default ui-corner-all" title="Comment"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></li></div>
                                      </td></tr>
                                    </table>   
                                </td>
                            </tr>
                            
                         </table>  
                        </td>
                    </tr> 
                    
                    
                </cfif> 
        	        
                	 <!---END COMMENT TEXT AREA--->
                            
                            <cfquery name="getComments" datasource="#client.company_dsn#" >
                
                                SELECT COMMENTID, COLLABCODE, USERID, MESSAGE, DATECREATED
                                  FROM ECINCOLLABDISC
                                 WHERE COLLABCODE = '#thetopiccode#'
                                 ORDER BY DATECREATED DESC
                                 <cfif Ucase(client.DBMS) EQ 'MYSQL'>
                                 LIMIT #beginning#, 2;
								 <cfelseif Ucase(client.DBMS) EQ 'MSSQL'>
								 	 OFFSET #beginning# ROWS
			 						 FETCH NEXT 2 ROWS ONLY;
								 </cfif>
                            
                            </cfquery>
                    
                    <tr>
                         <td border="0" bordercolor="#FFF" >&nbsp;</td>	
                    
                        <td>
                        <table border="0" bordercolor="#FFF" id="thecontainer">
                        
                        <cfset replycode = 'reply' />
                        <cfset counter   = 1 />				
                        
                            <!---COMMENT CONTENT--->
                   <cfloop query="getComments">
                            
                           
                             <!---get profile--->
                            <cfquery name="getProfile" datasource="#client.company_dsn#" maxrows="1">
                            
                                SELECT USERGRPID_FK, FOLDERCODE
                                  FROM ECRTCOLLAB
                                 WHERE USERID = '#getComments.USERID#' AND ISALLOWED = 'Y'
                                
                                 <cfif Ucase(client.DBMS) EQ 'MYSQL'>
                                 LIMIT 1;
								 <cfelseif Ucase(client.DBMS) EQ 'MSSQL'>
								 	;
								 </cfif>
                             
                             </cfquery>
                            <!---end get profile--->
                        
                            <cfset myfullname2   = getProfile.USERGRPID_FK />
                            <cfset myavatarreal2 = getProfile.FOLDERCODE />
                            
                                    <cfset replycode = "replyreply#counter##beginning#" />
                                    <cfset commenthideshow = "commenthide#counter##beginning#" />
                                        <!---convert time to words--->
                                        <cfset thedate = "#dateformat(getComments.DATECREATED, "YYYY-MM-DD")# #timeformat(getComments.DATECREATED, "HH:MM:SS")#" />
                                        
                                        <cfset ddiff_second = datediff("s", thedate, Now()) />
                                        <cfset ddiff_minute = datediff("n", thedate, Now()) />
                                        <cfset ddiff_hour   = datediff("h", thedate, Now()) />
                                        <cfset ddiff_day    = datediff("d", thedate, Now()) />
                                        <cfset ddiff_week   = datediff("w", thedate, Now()) />
                                        <cfset ddiff_month  = datediff("m", thedate, Now()) />
                                        <cfset ddiff_year   = datediff("yyyy", thedate, Now()) />
                                        
                                            <cfif ddiff_second LT 60 AND ddiff_minute LT 1 AND ddiff_hour LT 1 AND ddiff_day LT 1 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
												<cfif ddiff_second EQ 60>
                                                    <cfset aaggoo = 'about a minute ago'> 
                                                <cfelse>
                                                    <cfset aaggoo = 'a few seconds ago'> 
                                                </cfif>
                                                
                                            <cfelseif ddiff_minute LT 60 AND ddiff_hour LT 1 AND ddiff_day LT 1 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
                                                <cfif ddiff_minute EQ 60>
                                                    <cfset aaggoo = 'about an hour ago'>
                                                <cfelseif ddiff_minute EQ 1>
                                                    <cfset aaggoo = 'a minute ago'>
                                                <cfelse>
                                                    <cfset aaggoo = '#ddiff_minute# minutes ago'>
                                                </cfif>
                                                
                                            <cfelseif ddiff_hour LT 24 AND ddiff_day LT 1 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
                                                <cfif ddiff_hour EQ 24>
                                                    <cfset aaggoo = 'about a day ago'>
                                                <cfelseif ddiff_hour EQ 1>
                                                    <cfset aaggoo = 'about an hour ago'>
                                                <cfelseif ddiff_hour EQ 0>
                                                    <cfset aaggoo = '#ddiff_minute# minutes ago'>
                                                <cfelse>
                                                    <cfset aaggoo = '#ddiff_hour# hours ago'>
                                                </cfif>
                                                
                                            <cfelseif ddiff_day LT 7 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
                                                <cfif ddiff_day EQ 7>
                                                    <cfset aaggoo = 'about a week ago'>
                                                <cfelseif ddiff_day EQ 1>
                                                    <cfset aaggoo = 'about a day ago'>
                                                <cfelseif ddiff_day EQ 0>
                                                    <cfset aaggoo = '#ddiff_hour# hours ago'>
                                                <cfelse>
                                                    <cfset aaggoo = '#ddiff_day# days ago'>
                                                </cfif>
                                                
                                            <cfelseif ddiff_week LT 4 AND ddiff_month LT 1 AND ddiff_year LT 1>
                                                <cfif ddiff_week EQ 4>
                                                    <cfset aaggoo = 'about a month ago'>
                                                <cfelseif ddiff_week EQ 1>
                                                    <cfset aaggoo = 'about a week ago'>
                                                <cfelseif ddiff_week EQ 0>
                                                    <cfset aaggoo = '#ddiff_day# days ago'>
                                                <cfelse>
                                                    <cfset aaggoo = '#ddiff_week# weeks ago'>
                                                </cfif>
                                                
                                            <cfelseif ddiff_month LT 12 AND ddiff_year LT 1>
                                                <cfif ddiff_month EQ 12>
                                                    <cfset aaggoo = 'about a year ago'>
                                                <cfelseif ddiff_month EQ 1>
                                                    <cfset aaggoo = 'about a month ago'>
                                                <cfelseif ddiff_month EQ 0>
                                                    <cfset aaggoo = '#ddiff_week# weeks ago'>
                                                <cfelse>
                                                
                                                    <cfset aaggoo = '#ddiff_month# months ago'>
                                                </cfif>
                                                
                                            <cfelse>
                                                <cfif ddiff_year EQ 1>
                                                    <cfset aaggoo = 'about a year ago'>
                                                <cfelse>
                                                    <cfset aaggoo = '#ddiff_year# years ago'>
                                                </cfif>
                                            </cfif>
                                                    
                                                   
                                                
                            <tr>
                                 <td ><div style="width: 50px; height: 50px;" onclick="hideshow('<cfoutput>#commenthideshow#</cfoutput>')"><img alt="no image" src="<cfoutput>#myavatarreal2#</cfoutput>" width="100%" height="100%"/></div>
                                 </td>
                                 <td border="0" bordercolor="#FFF" style="border-top: solid 1px #CCC;">
                                      <table border="0" bordercolor="#FFF" >
                                        <tr><td style="font-size: .9em; font-family: Arial, Helvetica, sans-serif"><cfoutput><strong>#myfullname2#&nbsp;&nbsp;&nbsp;</strong>  <span style="font-size: .8em" title="<cfoutput>#thedate#</cfoutput>">#aaggoo#</span></cfoutput></td></tr>
                                      </table> 
                                 </td>
                            </tr>
                            <tr id="<cfoutput>#commenthideshow#</cfoutput>">
                                 <td >&nbsp; 
                                 </td>
                                 <td>
                                      <table border="0" bordercolor="#FFF" >
                                       <cfset replyid = "replyhere#counter##beginning#">
                                        <tr>
                                        	<td style="font-size: .8em; font-family: Arial, Helvetica, sans-serif;"><cfoutput>#MESSAGE#</cfoutput>
                                            
                                        	<li style="list-style: none; height: auto; width: 40px;" onclick="replynow('<cfoutput>#replycode#</cfoutput>', '<cfoutput>#client.USERID#</cfoutput>', '<cfoutput>#replyid#</cfoutput>')" class="ui-state-default ui-corner-all" title="Reply"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></li></div>
                                        	</td>
                                        </tr>
                                        
                                        <tr  >
                                            <td>
                                                <table border="0" bordercolor="#FFF" style="display: none; border-top-color: #CCC; border-left-color: #FFF; border-right-color: #FFF;  border-bottom-color: #FFF; " id="<cfoutput>#replycode#</cfoutput>">
                                                    <!---REPLY TEXT AREA--->    
                                                    <tr>  
                                                        <td><div style="width: 40px; height: 40px;"><img alt="no image" src="<cfoutput>#myavatarreal#</cfoutput>" width="100%" height="100%"/></div></td>
                                                        <td>
                                                          <table border="0" style="border-top-color: #CCC; border-left-color: #FFF; border-right-color: #FFF;  border-bottom-color: #FFF; " >
                                                            
                                                            <cfset replycounter =    "replycontainer#counter##beginning#">
                                                            <tr><td><textarea class="textarear" id="<cfoutput>#replyid#</cfoutput>" placeholder="Write a reply..." style="width: 300px;"></textarea><!---<a href="##" style="font-size: .7em;" onclick="replyclick('<cfoutput>#replycounter#</cfoutput>', '<cfoutput>#replyid#</cfoutput>', '<cfoutput>#getComments.COMMENTID#</cfoutput>', '<cfoutput>#myavatarreal#</cfoutput>', '<cfoutput>#client.USERID#</cfoutput>', '<cfoutput>#namefull#</cfoutput>', '<cfoutput>#getComments.COLLABCODE#</cfoutput>')">Reply</a>--->
                                                            	<li style="list-style: none; height: auto; width: 20px;" onclick="replyclick('<cfoutput>#replycounter#</cfoutput>', '<cfoutput>#replyid#</cfoutput>', '<cfoutput>#getComments.COMMENTID#</cfoutput>', '<cfoutput>#myavatarreal#</cfoutput>', '<cfoutput>#client.USERID#</cfoutput>', '<cfoutput>#namefull#</cfoutput>', '<cfoutput>#getComments.COLLABCODE#</cfoutput>')" class="ui-state-default ui-corner-all" title="Reply"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></li></div>
                                                            </td></tr>
                                                          </table>
                                                        </td>  
                                                    </tr> 
                                                    
                                                    <!--- END REPLY TEXT ARE --->
                                                 </table>
                                            
                                            </td>
                                        </tr>
                                        
                                        <tr>
                                        </tr>
                                            <td>
                                         
                                              
                                              
                                                    
                                               <table border="0" bordercolor="#FFFFFF" id="<cfoutput>#replycounter#</cfoutput>">
                                               
                                               <cfquery name="getReply" datasource="#client.company_dsn#">
                                       
                                                    SELECT COMMENTID, CONTENTS, DATECREATED, USERID
                                                    FROM ECINCOLLABSHARED
                                                    WHERE COMMENTID = '#getComments.COMMENTID#'
                                                    ORDER BY DATECREATED DESC;
                                               
                                                </cfquery> 
                                                
                                                
                                       
                                       
                                       		  <cfset replycode = 0 />
                                              <cfloop query="getReply">
                                              
                                              
                                                   <cfset thedate = "#dateformat(getReply.DATECREATED, "YYYY-MM-DD")# #timeformat(getReply.DATECREATED, "HH:MM:SS")#" />
                                        
													<cfset ddiff_second = datediff("s", thedate, Now()) />
                                                    <cfset ddiff_minute = datediff("n", thedate, Now()) />
                                                    <cfset ddiff_hour   = datediff("h", thedate, Now()) />
                                                    <cfset ddiff_day    = datediff("d", thedate, Now()) />
                                                    <cfset ddiff_week   = datediff("w", thedate, Now()) />
                                                    <cfset ddiff_month  = datediff("m", thedate, Now()) />
                                                    <cfset ddiff_year   = datediff("yyyy", thedate, Now()) />
                                                    
                                                        <cfif ddiff_second LT 60 AND ddiff_minute LT 1 AND ddiff_hour LT 1 AND ddiff_day LT 1 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
															<cfif ddiff_second EQ 60>
                                                                <cfset aaggoo = 'about a minute ago'> 
                                                            <cfelse>
                                                                <cfset aaggoo = 'a few seconds ago'> 
                                                            </cfif>
                                                            
                                                        <cfelseif ddiff_minute LT 60 AND ddiff_hour LT 1 AND ddiff_day LT 1 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
                                                            <cfif ddiff_minute EQ 60>
                                                                <cfset aaggoo = 'about an hour ago'>
                                                            <cfelseif ddiff_minute EQ 1>
                                                                <cfset aaggoo = 'a minute ago'>
                                                            <cfelse>
                                                                <cfset aaggoo = '#ddiff_minute# minutes ago'>
                                                            </cfif>
                                                            
                                                        <cfelseif ddiff_hour LT 24 AND ddiff_day LT 1 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
                                                            <cfif ddiff_hour EQ 24>
                                                                <cfset aaggoo = 'about a day ago'>
                                                            <cfelseif ddiff_hour EQ 1>
                                                                <cfset aaggoo = 'about an hour ago'>
                                                            <cfelseif ddiff_hour EQ 0>
                                                                <cfset aaggoo = '#ddiff_minute# minutes ago'>
                                                            <cfelse>
                                                                <cfset aaggoo = '#ddiff_hour# hours ago'>
                                                            </cfif>
                                                            
                                                        <cfelseif ddiff_day LT 7 AND ddiff_week LT 1 AND ddiff_month LT 1 AND ddiff_year LT 1>
                                                            <cfif ddiff_day EQ 7>
                                                                <cfset aaggoo = 'about a week ago'>
                                                            <cfelseif ddiff_day EQ 1>
                                                                <cfset aaggoo = 'about a day ago'>
                                                            <cfelseif ddiff_day EQ 0>
                                                                <cfset aaggoo = '#ddiff_hour# hours ago'>
                                                            <cfelse>
                                                                <cfset aaggoo = '#ddiff_day# days ago'>
                                                            </cfif>
                                                            
                                                        <cfelseif ddiff_week LT 4 AND ddiff_month LT 1 AND ddiff_year LT 1>
                                                            <cfif ddiff_week EQ 4>
                                                                <cfset aaggoo = 'about a month ago'>
                                                            <cfelseif ddiff_week EQ 1>
                                                                <cfset aaggoo = 'about a week ago'>
                                                            <cfelseif ddiff_week EQ 0>
                                                                <cfset aaggoo = '#ddiff_day# days ago'>
                                                            <cfelse>
                                                                <cfset aaggoo = '#ddiff_week# weeks ago'>
                                                            </cfif>
                                                            
                                                        <cfelseif ddiff_month LT 12 AND ddiff_year LT 1>
                                                            <cfif ddiff_month EQ 12>
                                                                <cfset aaggoo = 'about a year ago'>
                                                            <cfelseif ddiff_month EQ 1>
                                                                <cfset aaggoo = 'about a month ago'>
                                                            <cfelseif ddiff_month EQ 0>
                                                                <cfset aaggoo = '#ddiff_week# weeks ago'>
                                                            
                                                            <cfelse>
                                                                <cfset aaggoo = '#ddiff_month# months ago'>
                                                            </cfif>
                                                            
                                                        <cfelse>
                                                            <cfif ddiff_year EQ 1>
                                                                <cfset aaggoo = 'about a year ago'>
                                                            <cfelse>
                                                                <cfset aaggoo = '#ddiff_year# years ago'>
                                                            </cfif>
                                                        </cfif>
                                                    
                                                    <!---get Personnel ID number --->
                                                   
                                                   
                                                    
                                                    <!---get profile---> 
                                                    <cfquery name="getProfile" datasource="#client.company_dsn#" maxrows="1" >
                                                    
                                                        SELECT USERGRPID_FK, FOLDERCODE
                                                          FROM ECRTCOLLAB
                                                         WHERE USERID = '#getReply.USERID#' AND ISALLOWED = 'Y'
                                                         
														 <cfif Ucase(client.DBMS) EQ 'MYSQL'>
						                                 LIMIT 1;
														 <cfelseif Ucase(client.DBMS) EQ 'MSSQL'>
														 	 ;
														 </cfif>
                                                    
                                                     </cfquery>
                                                    <!---end get profile--->
                                                
                                                    <cfset myfullname3   = getProfile.USERGRPID_FK />
                                                    <cfset myavatarreal3 = getProfile.FOLDERCODE />
                                       
                                        <!---REPLY CONTENT--->   
                                        		<cfset idrephide = "hidereplyyy#replycode##counter##beginning#" />
                                        			
                                                 <tr>
                                                       <td><div style="width: 40px; height: 40px;" onclick="hideshow('<cfoutput>#idrephide#</cfoutput>')"><img alt="no image" src="<cfoutput>#myavatarreal3#</cfoutput>" width="100%" height="100%"/></div>
                                                       </td>
                                                       <td>
                                                         <table border="0" bordercolor="#FFF">
                                                            <tr><td style="font-size: .9em; font-family: Arial, Helvetica, sans-serif"><cfoutput><strong>#myfullname3#&nbsp;&nbsp;&nbsp;</strong>  <span style="font-size: .8em" title="<cfoutput>#thedate#</cfoutput>">#aaggoo#</span></cfoutput></td></tr>
                                                         </table>
                                                       </td>
                                                  </tr>
                                                  
                                                   <tr id="<cfoutput>#idrephide#</cfoutput>">
                                                     <td>&nbsp;</td>
                                                        <td>
                                                          <table border="0" bordercolor="#FFFFFF" >
                                                            <tr><td style="font-size: .8em; font-family: Arial, Helvetica, sans-serif;"><cfoutput>#CONTENTS#</cfoutput></td></tr>
                                                          </table>
                                                        </td>
                                                   </tr>
                                                    <!---END REPLY CONTENT--->
                                                    
                                                     <cfset replycode = replycode + 1 />
                                                    </cfloop> 
                                                    
                                                </table>
                                                
                                                
                                                
                                             </td>
                                             
                                           
                                             
                                      </table> 
                                 </td>
                            </tr>
                            
                            <cfset counter   = counter + 1 />
                            
                            </cfloop>
                            <!---END COMMENT CONTENT--->        
                        
                        
                        
                       </table>
                       
                    </td>
                    <!---END COMMENT BLOCK--->
                    
                </tr> <!---END THIRD ROW--->
                
                
    

<cfelse>
 
	<cfoutput>No accessible topic.</cfoutput>

</cfif>


<cfoutput>~trimendshere2~</cfoutput> 

<cfoutput>~trimstartstatus~</cfoutput>
	<cfset returnnumstat = Trim(getComments.RecordCount) />
	<cfoutput>#returnnumstat#</cfoutput>
<cfoutput>~trimendstatus~</cfoutput>

<cfoutput>~trimstartcollab~</cfoutput>
	<cfset returntopic = thetopiccode />
	<cfoutput>#returntopic#</cfoutput>
<cfoutput>~trimendcollab~</cfoutput>

<cfoutput>~trimstartbeginn~</cfoutput>
	<cfset returntopic = beginning + 2 />
	<cfoutput>#returntopic#</cfoutput>
<cfoutput>~trimendbegin~</cfoutput>


</body>
</html>
